<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #container {
            overflow: hidden;
            width: calc(130px * 5);
        }

        #box {
            width: calc(130px * 10);
        }

        .item {
            display: inline-block;
            margin-right: 25px;
            width: 100px;
            height: 100px;
        }

        #box {
            animation: scroll 5s linear infinite;
        }

        #box:hover {
            animation-play-state: paused;
        }

        @keyframes scroll {
            0% { transform: translateX(0%); }
            100% { transform: translateX(-50%); }
            /* 根据需求调整滚动位移值 */
        }

    </style>
</head>

<body>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div id="container">
        <div id="box">
            <div class="item" style="background-color: red;">1</div>
            <div class="item" style="background-color: blue;">2</div>
            <div class="item" style="background-color: yellow;">3</div>
            <div class="item" style="background-color:green;">4</div>
            <div class="item" style="background-color: aqua;">5</div>
        </div>
    </div>

    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    <div>12313131</div>
    123131313123131313

    <script>
        var container = document.getElementById("container");

        var box = document.getElementById('box');
        box.innerHTML = box.innerHTML + box.innerHTML;
    </script>
</body>

</html>